package org.tacademy.homework3;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;

public class Homework3Activity extends TabActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        setUpTabs();
    }
    
    private void setUpTabs(){
    	TabHost tabs = getTabHost();
    	
    	TabHost.TabSpec spec = null;
    	Intent intent = null;
    	
    	spec = tabs.newTabSpec("tab01");
    	intent = new Intent(this,WebPageActivity.class);
  //  	intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    	spec.setContent(intent);
    	spec.setIndicator("web");
    	tabs.addTab(spec);
    	
    	spec = tabs.newTabSpec("tab02");
    	intent = new Intent(this,SlidingPageActivity.class);
   // 	intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    	spec.setContent(intent);
    	spec.setIndicator("page sliding");
    	tabs.addTab(spec);
    	
    	spec = tabs.newTabSpec("tab03");
    	intent = new Intent(this,ListViewPageActivity.class);
 //   	intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    	spec.setContent(intent);
    	spec.setIndicator("list view");
    	tabs.addTab(spec);
    	
    	tabs.setCurrentTab(0);
    }
}